package com.zdp.jpa.test.control;

import com.zdp.jpa.test.entity.User;
import com.zdp.jpa.test.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ZhengDp
 * @Date 2023/7/13 23:35
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserRepository userRepository;

    @GetMapping
    public Iterable<User> listUsers() {
        return userRepository.findAll();
    }

}
